{% extends "base.html" %}
{% block content %}
<div class="card">
  <h2>银行卡列表</h2>
  <a href="{{ url_for('add_card') }}" class="btn">➕ 添加银行卡</a>
  <a href="{{ url_for('export_cards') }}" class="btn">📄 导出数据</a>

  <table class="table">
    <thead>
      <tr>
        <th>卡号</th><th>类型</th><th>开户日期</th><th>开户金额</th>
        <th>余额</th><th>密码</th><th>挂失</th><th>客户编号</th><th>操作</th>
      </tr>
    </thead>
    <tbody>
    {% for card in cards %}
      <tr>
        <td>{{ card.cardID }}</td>
        <td>{{ card.type }}</td>
        <td>{{ card.openDate }}</td>
        <td>{{ card.initAmount }}</td>
        <td>{{ card.balance }}</td>
        <td>{{ card.password }}</td>
        <td>{{ '是' if card.lost else '否' }}</td>
        <td>{{ card.customerID }}</td>
        <td>
          <a href="{{ url_for('edit_card', cardID=card.cardID) }}" class="btn">编辑</a>
          <a href="{{ url_for('delete_card', cardID=card.cardID) }}" class="btn">删除</a>
        </td>
      </tr>
    {% endfor %}
    </tbody>
  </table>
</div>
{% endblock %}
